home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Tools & Apps / Misc. Utilities / Installer / Installer 3.2 / Samples - Installer 3.2 / AddAuditTrail.r < prev    next >
Encoding:
Text File  |  1992-01-22  |  4.6 KB  |  131 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: adding an audit trail
  6.  *
  7.  *    File:        AddAuditTrail.r -    Rez Source
  8.  *
  9.  *    by:            Jon Zap
  10.  *
  11.  *    Copyright © 1991 Apple Computer, Inc.
  12.  *    All rights reserved.
  13.  *
  14.  *------------------------------------------------------------------------------
  15.  *
  16.  * Install "TheProgram" into the folder "Root":Installed Application and then
  17.  * add an audit record to the system file.  Note that in 3.1 there was a bug in the
  18.  * installer that required us to touch the target file with a file or resource atom;
  19.  * this bug has been fixed.
  20.  *----------------------------------------------------------------------------*/
  21.  
  22. #include "InstallerTypes.r"
  23.  
  24. /* You can build and complete the script with the following lines:
  25. # Note: set up floppies with the appropriate names and contents before running scriptcheck
  26. # or set up folders with the same names and contents as the floppies
  27. # put these folders in the same folder as the script or at the root directory of same disk
  28.  
  29.     rez -o "AddAuditTrail" -t 'bjbc' -c 'bjbc' "AddAuditTrail.r"
  30.     setfile -a i "AddAuditTrail"        #mark Inited
  31.     scriptcheck -p "AddAuditTrail"
  32. */
  33.  
  34. /* put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
  35. #define kScriptCheckSetsDate    0x01
  36.  
  37. /* Defines for the file spec atoms (specifications for source and destination files) */
  38. #define fsSourceProgram            2000
  39. #define fsTargetProgram            2001
  40. #define fsTargetSystem            2002
  41.  
  42. /* This is the name of the source disk */
  43. #define ProgramDisk "Program Disk:"
  44.  
  45. /* This is the target path for where we want to install the file. */
  46. #define TargetPath    ":Installed Application:"
  47.  
  48. /* Definition for the package. */
  49. #define pkTheProgram            3000
  50.  
  51. /* Definition for the file atom */
  52. #define faProgram                4000
  53.  
  54. /* Definition for the audit atom */
  55. #define atProgram                5000
  56. #define auditProgram            'MOOF'
  57. #define auditProgVer            2
  58.  
  59. /***************************** Package Resources ************************************************/
  60. resource 'inpk' (pkTheProgram) {
  61.     format0 {
  62.         showsOnCustom,             /* Package appears in the Custom Install display */
  63.         removable,                /* Package can be removed */
  64.         dontForceRestart,        /* adding an audit atom to system file doesn't require reboot */
  65.         0,                         /* 'icmt' not required */
  66.         0,                        /* Package size (filled in by ScriptCheck) */
  67.         "The Program audit", {        /* package name */
  68.             'infa', faProgram;
  69.             'inat', atProgram;
  70.         }
  71.     }
  72. };
  73.  
  74. /********************************************* File Specs ***************************************/
  75. /* Source File Specs */
  76. resource 'infs' (fsSourceProgram) {
  77.     'APPL',                                /* File Type */
  78.     'Arfz',                                /* Creator */
  79.     kScriptCheckSetsDate,                /* ScriptCheck will fill in the creation date */
  80.     noSearchForFile,                    /* Do not search the source disk for the file */
  81.     typeCrMustMatch,                    /* file type and creator on this file must match */
  82.     ProgramDisk"TheProgram"                /* Path to the file */
  83. };
  84.  
  85. /* Target File Specs */
  86. resource 'infs' (fsTargetProgram) {
  87.     'APPL',                                /* File Type */
  88.     'Arfz',                                /* Creator */
  89.     0,                                    /* not needed for target file spec */
  90.     noSearchForFile,                    /* Do not search the target disk for the file */
  91.     typeCrMustMatch,                    /* not needed for target file specs */
  92.     TargetPath"TheProgram"                /* installation Path */
  93. };
  94.  
  95. resource 'infs' (fsTargetSystem) {
  96.     'ZSYS',                                /* File Type */
  97.     'MACS',                                /* Creator */
  98.     0,                                    /* not needed for target file spec */
  99.     noSearchForFile,                    /* Do not search the target disk for the file */
  100.     typeCrNeedNotMatch,                    /* not needed for target file specs */
  101.     "Blessed:System"                    /* installation Path */
  102. };
  103.  
  104. /***************************************** File Atoms ************************************************/
  105. resource 'infa' (faProgram) {
  106.     format0 {
  107.         deleteWhenRemoving,                /* Delete the file if remove (option-custom) is clicked    */
  108.         dontDeleteWhenInstalling,         /* don't need to predelete the target before copying new one */
  109.         copy,                             /* Copy the file to the destination */
  110.         leaveAloneIfNewer,                 /* do not Install this version, if newer one exists */
  111.         updateExisting,                 /* replace an existing copy, if mine is newer */
  112.         noUpdateOnly,                    /* Copy whether the target file exists or not */
  113.         rsrcFork, dataFork,                /* Copy both forks of the file */
  114.         fsTargetProgram,                /* TARGET file spec */
  115.         fsSourceProgram,                 /* SOURCE file spec */
  116.         0,                                /* atom size (filled in by ScriptCheck) */
  117.         ""                                /* Atom Description (for a file Installer will use file name) */
  118.     };
  119. };
  120.  
  121. resource 'inat' (atProgram) {
  122.     format0 {
  123.         fsTargetSystem,
  124.         auditProgram,
  125.         auditProgVer
  126.     };
  127. };
  128.  
  129.  
  130.  
  131.